/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package layer;

import event.RecoveryEvent;
import event.TrustEvent;
import net.sf.appia.core.Layer;
import net.sf.appia.core.Session;
import net.sf.appia.core.events.SendableEvent;
import net.sf.appia.core.events.channel.ChannelInit;
import net.sf.appia.protocols.common.RegisterSocketEvent;
import session.EventualLeaderDetectorSession;

/**
 *
 * @author Gustavo
 */
public class EventualLeaderDetectorLayer extends Layer{
    
     public EventualLeaderDetectorLayer() {
        /* events that the protocol will create */
        evProvide = new Class[2];
        evProvide[0] = TrustEvent.class;
        evProvide[0] = SendableEvent.class;

        /*
         * events that the protocol requires to work. It is a subset of the
         * accepted events.
         */
        evRequire = new Class[1];
        evRequire[0] = RecoveryEvent.class;
        
        /* events that the protocol will accept */
        evAccept = new Class[3];
        evAccept[0] = ChannelInit.class;
        evAccept[1] = RegisterSocketEvent.class;
        evAccept[2] = TrustEvent.class;
    }
        
    @Override
    public Session createSession() {
        return new EventualLeaderDetectorSession(this);
    }
    
}
